package com.itheima.day03Dome04;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Calendar01 {

    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();

        System.out.println(calendar.get(Calendar.YEAR)+"年"+calendar.get(Calendar.MONTH)+"月"+calendar.get(Calendar.DATE)+"日");

        System.out.println(calendar.get(Calendar.HOUR)+"时"+calendar.get(Calendar.MINUTE)+"分"+calendar.get(Calendar.SECOND)+"秒");


        Calendar calendar1 = Calendar.getInstance();
        calendar1.add(Calendar.DATE, 100);



        String week = getWeek(calendar1.get(Calendar.DAY_OF_WEEK));
        System.out.println("100天后是" + week);

    }

    public static String getWeek(int i) {
        String[] weekArray = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
        return weekArray[i - 1];
    }

}
